<template>
  <div v-for="it in 4" :key="it">
    <div
      style="
        margin: 0 auto;
        display: flex;
        justify-content: space-between;
        height: 100px;
        width: 1240px;
        align-items: center;
      "
    >
      <XtxSkeleton bg="#e4e4e4" width="240px" height="35px" />
      <XtxSkeleton bg="#e4e4e4" width="600px" height="35px" />
    </div>
    <div class="prodect-skeleton">
      <XtxSkeleton bg="#e4e4e4" width="240px" height="610px" />
      <div class="goods-list" style="width: 990px">
        <div class="item" v-for="i in 8" :key="i" style="display: inline-block">
          <XtxSkeleton bg="#e4e4e4" width="160px" height="160px" />
          <XtxSkeleton bg="#e4e4e4" width="178px" height="44px" />
          <XtxSkeleton bg="#e4e4e4" width="178px" height="22px" />
          <XtxSkeleton bg="#e4e4e4" width="178px" height="28px" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'ProductSkeleton'
}
</script>

<style scoped lang='less'>
.goods-list {
  width: 990px;
  display: flex;
  flex-wrap: wrap;
  div {
    width: 240px;
    height: 300px;
    margin-right: 10px;
    margin-bottom: 10px;
    &:nth-last-child(-n + 4) {
      margin-bottom: 0;
    }
    &:nth-child(4n) {
      margin-right: 0;
    }
  }
}
.prodect-skeleton {
  margin: 16px auto;
  width: 1240px;
  height: 600px;
  display: flex;
  // flex-direction: row;
  // flex-wrap: wrap;
  justify-content: space-between;
  text-align: center;

  .item {
    // margin-bottom: 10px;
    .xtx-skeleton ~ .xtx-skeleton {
      margin: 16px auto 0;
    }
  }
}
</style>
